:root {
    /* 默认深色主题 */
    --primary-color: #1bb76e;
    --primary-hover: #1da462;
    --background-dark: #141518;
    --card-dark: #2c2f34;
    --header-dark: #1b1b1b;
    --text-primary: #ffffff;
    --text-secondary: #b4b9c2;
    --border-color: #41454c;
}

/* 绿色主题 */
[data-theme="green"] {
    --primary-color: #10b981;
    --primary-hover: #059669;
    --background-dark: #064e3b;
    --card-dark: #065f46;
    --header-dark: #064e3b;
    --text-primary: #ffffff;
    --text-secondary: #a7f3d0;
    --border-color: #047857;
}

/* 蓝色主题 */
[data-theme="blue"] {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --background-dark: #1e3a8a;
    --card-dark: #1e40af;
    --header-dark: #1e3a8a;
    --text-primary: #ffffff;
    --text-secondary: #bfdbfe;
    --border-color: #3b82f6;
}

/* 紫色主题 */
[data-theme="purple"] {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --background-dark: #4c1d95;
    --card-dark: #5b21b6;
    --header-dark: #4c1d95;
    --text-primary: #ffffff;
    --text-secondary: #ddd6fe;
    --border-color: #7c3aed;
}

/* 橙色主题 */
[data-theme="orange"] {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --background-dark: #7c2d12;
    --card-dark: #9a3412;
    --header-dark: #7c2d12;
    --text-primary: #ffffff;
    --text-secondary: #fed7aa;
    --border-color: #ea580c;
}

/* 粉色主题 */
[data-theme="pink"] {
    --primary-color: #ec4899;
    --primary-hover: #db2777;
    --background-dark: #831843;
    --card-dark: #9d174d;
    --header-dark: #831843;
    --text-primary: #ffffff;
    --text-secondary: #fbcfe8;
    --border-color: #db2777;
}

/* 主题配色 */
[data-theme="emerald"] {
    --primary-color: #10b981;
    --primary-hover: #059669;
    --background-dark: #064e3b;
    --card-dark: #065f46;
    --header-dark: #064e3b;
    --text-primary: #ffffff;
    --text-secondary: #a7f3d0;
    --border-color: #047857;
    --primary-color-rgb: 16, 185, 129;
}

[data-theme="ocean"] {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --background-dark: #1e3a8a;
    --card-dark: #1e40af;
    --header-dark: #1e3a8a;
    --text-primary: #ffffff;
    --text-secondary: #bfdbfe;
    --border-color: #3b82f6;
    --primary-color-rgb: 59, 130, 246;
}

[data-theme="amethyst"] {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --background-dark: #4c1d95;
    --card-dark: #5b21b6;
    --header-dark: #4c1d95;
    --text-primary: #ffffff;
    --text-secondary: #ddd6fe;
    --border-color: #7c3aed;
    --primary-color-rgb: 139, 92, 246;
}

/* 浅色主题 */
[data-theme="light"] {
    --primary-color: #1bb76e;
    --primary-hover: #1da462;
    --background-dark: #f3f4f6;
    --card-dark: #ffffff;
    --header-dark: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #e5e7eb;
    --primary-color-rgb: 27, 183, 110;
}

/* 浅色主题特殊处理 */
[data-theme="light"] .theme-menu,
[data-theme="light"] .sort-menu {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .settings-button {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .magnet-item {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .search-button,
[data-theme="light"] .copy-button {
    color: #ffffff;
}

[data-theme="light"] .theme-menu-item {
    color: #1f2937;
}

[data-theme="light"] .theme-menu-item:hover {
    color: #ffffff;
}

[data-theme="light"] .sort-menu .theme-menu-item {
    color: #1f2937;
}

[data-theme="light"] .sort-menu .theme-menu-item:hover {
    color: #ffffff;
}

[data-theme="light"] input {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .tab-button {
    color: #6b7280;
}

[data-theme="light"] .tab-button:hover {
    color: #374151;
}

[data-theme="light"] .tab-button.active {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
}

[data-theme="light"] .notification {
    background: var(--primary-color);
    color: #ffffff;
    border: 1px solid #e5e7eb;
}

body {
    background-color: var(--background-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

.bg-header {
    background-color: var(--header-dark);
}

.bg-card {
    background-color: var(--card-dark);
}

.magnet-item {
    transition: all 0.2s ease;
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.magnet-item:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
}

/* 搜索按钮样式 */
.search-button {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    min-width: 100px;
}

.search-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.search-button:active {
    transform: translateY(0);
}

/* 统一按钮样式（复制按钮和下一个按钮） */
.next-button, .copy-button {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
    position: relative;
    overflow: hidden;
}

/* 确保下一个按钮靠右 */
.next-button {
    margin-left: auto;
}

.next-button:hover, .copy-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 183, 110, 0.2);
}

.next-button::before, .copy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.next-button:hover::before, .copy-button:hover::before {
    left: 100%;
}

/* 视频控制区域样式 */
.video-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
    gap: 1rem;
}

/* 左侧自动播放开关组 */
.video-controls-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 自动播放开关容器 */
.autoplay-toggle {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 移除旧的margin-left设置 */
.video-controls .autoplay-toggle + .autoplay-toggle {
    margin-left: 0;
}

.tab-container {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: var(--card-dark);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tab-button {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.tag[data-type="hd"] {
    background: #3b82f6;
}

.tag[data-type="subtitle"] {
    background: #22c55e;
}

.tag[data-type="uncensored"] {
    background: #ef4444;
}

.tag[data-type="chinese"] {
    background: #a855f7;
}

.tag[data-type="leak"] {
    background: #f59e0b;
}

/* 修改标签颜色 */
.tag[data-type="hd"] {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.tag[data-type="subtitle"] {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.tag[data-type="uncensored"] {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.tag[data-type="chinese"] {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.2);
}

.tag[data-type="leak"] {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

/* 亮色主题下的标签样式微调 */
[data-theme="light"] .tag {
    opacity: 0.9;
}

/* 设置区域样式 */
.settings-container {
    position: fixed;
    top: 16px;
    right: 5%;
    display: flex;
    gap: 8px;
    z-index: 1000;
}

/* 设置按钮样式 */
.settings-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    height: 40px;
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-button svg {
    width: 20px;
    height: 20px;
}

/* 语言切换按钮文字样式 */
.language-text {
    line-height: 20px;
}

/* 主题切换按钮样式 */
#themeToggle {
    padding: 8px;
    width: 40px;
}

/* 主题菜单样式 */
.theme-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    width: max-content;
    min-width: 100px;
    z-index: 1001;
}

.theme-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    width: 100%;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

/* 亮色主题下的菜单样式 */
[data-theme="light"] .theme-menu {
    background: #ffffff;
    border-color: #e5e7eb;
}

[data-theme="light"] .theme-menu-item {
    color: #1f2937;
}

[data-theme="light"] .theme-menu-item:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
}

/* 深色主题下的菜单样式 */
[data-theme="dark"] .theme-menu {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .theme-menu-item {
    color: #ffffff;
}

[data-theme="dark"] .theme-menu-item:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
}

/* 主题选项图标颜色 */
.theme-menu-item[data-theme="dark"] svg {
    color: #94a3b8;
}

.theme-menu-item[data-theme="light"] svg {
    color: #fbbf24;
}

.theme-menu-item[data-theme="emerald"] svg {
    color: #10b981;
}

.theme-menu-item[data-theme="ocean"] svg {
    color: #3b82f6;
}

.theme-menu-item[data-theme="amethyst"] svg {
    color: #8b5cf6;
}

/* 主题选项悬停效果 */
.theme-menu-item:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
}

/* 当前选中的主题样式 */
.theme-menu-item[data-active="true"] {
    background: rgba(var(--primary-color-rgb), 0.1);
}

.theme-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 搜索框样式修复 */
[data-theme="light"] input {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] input::placeholder {
    color: #9ca3af;
}

#searchInput {
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

/* 排序按钮容器样式 */
.sort-button-container {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

/* 排序按钮样式 */
#sortButton {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

#sortButton:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

#sortButton svg {
    flex-shrink: 0;
}

#sortButton span {
    white-space: nowrap;
}

/* 排序菜单样式优化 */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    width: max-content;
    min-width: 120px;
    max-width: 160px;
    z-index: 100;
}

.sort-menu .theme-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    width: 100%;
    color: var(--text-primary);
    transition: all 0.2s;
    border-radius: 6px;
    font-size: 14px;
}

.sort-menu .theme-menu-item:hover {
    background: var(--primary-color);
    color: white;
}

.sort-menu .theme-menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sort-menu .theme-menu-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 语言切换按钮样式 */
.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    width: max-content;
    min-width: 100px;
    z-index: 1001;
}

.language-menu .theme-menu-item {
    padding: 8px 12px;
    gap: 8px;
}

.language-menu .theme-menu-item svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.language-menu .theme-menu-item span {
    flex-grow: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 当前选中的语言样式 */
.language-menu .theme-menu-item[data-active="true"] {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
}

.language-menu .theme-menu-item[data-active="true"]:hover {
    color: white;
    background: var(--primary-color);
}

/* 确保语言切换按钮与主题切换按钮大小一致 */
#languageToggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 输入框和选择框样式优化 */
input, select {
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 8px 12px;
}

/* 输入框占位符颜色 */
input::placeholder {
    color: var(--text-secondary);
}

/* 选择框选项样式 */
select option {
    background: var(--card-dark);
    color: var(--text-primary);
    padding: 8px;
}

/* 排序选择框样式 */
#sortSelect {
    background-color: var(--card-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 28px 6px 12px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23b4b9c2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

#sortSelect:hover {
    border-color: var(--primary-color);
}

#sortSelect:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(27, 183, 110, 0.2);
}

/* 暗色主题下的输入框和选择框 */
body:not(.light-theme) input,
body:not(.light-theme) select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body:not(.light-theme) input:hover,
body:not(.light-theme) select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

body:not(.light-theme) input:focus,
body:not(.light-theme) select:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

body:not(.light-theme) input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 暗色主题下的选择框选项 */
body:not(.light-theme) select option {
    background: var(--background-dark);
    color: var(--text-primary);
}

/* 亮色主题下的输入框和选择框 */
body.light-theme input,
body.light-theme select {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #333333;
}

body.light-theme input::placeholder {
    color: #9ca3af;
}

body.light-theme input:hover,
body.light-theme select:hover {
    border-color: #d1d5db;
}

body.light-theme input:focus,
body.light-theme select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(27, 183, 110, 0.1);
}

body.light-theme select option {
    background: #ffffff;
    color: #333333;
}

/* 消息通知样式 */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary-color);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification svg {
    width: 20px;
    height: 20px;
}

/* 修复复制按钮点击后的文字颜色 */
[data-theme="light"] .copy-button.success {
    background: #10b981;
    color: #ffffff;
}

[data-theme="light"] .copy-button.copied {
    background: #10b981;
    color: #ffffff;
}

/* 确保复制按钮在所有状态下文字颜色保持一致 */
.copy-button,
.copy-button:hover,
.copy-button:active,
.copy-button.success,
.copy-button.copied {
    color: #ffffff;
}

[data-theme="light"] .copy-button,
[data-theme="light"] .copy-button:hover,
[data-theme="light"] .copy-button:active,
[data-theme="light"] .copy-button.success,
[data-theme="light"] .copy-button.copied {
    color: #ffffff;
}

/* 修改加载容器样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px;
    width: 100%;
    background: transparent;
    box-shadow: none;
}

/* 加载动画圆圈 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
    margin: 0 auto;
    display: block;
}

/* 加载动画旋转效果 */
@keyframes loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载文本样式 */
.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

/* 确保浅色主题下的加载状态也是完全透明的 */
[data-theme="light"] .loading-container {
    background: transparent;
    box-shadow: none;
}

/* 搜索结果容器 */
#searchResults {
    position: relative;
    z-index: 1;
}

/* 搜索结果中的加载容器 */
#searchResults .loading-container {
    box-shadow: none;
}

/* Logo 样式 */
.logo-container {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 50;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

.logo {
    display: inline-flex;
    align-items: center;
    font-family: Arial, sans-serif;
    font-weight: 800;
    font-size: 32px;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.logo-av {
    color: #ffffff;
}

.logo-hub {
    color: #000000;
    background-color: #ff9000;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 亮色主题适配 */
[data-theme="light"] .logo-container {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .logo-av {
    color: #000000;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .logo {
        font-size: 24px;
    }
    
    .logo-container {
        padding: 2px 6px;
    }
} 

/* 语言图标样式 */
.lang-icon {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-to-top.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* 视频源地址容器样式 */
.video-source {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* 防止换行 */
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

/* 视频源URL容器 */
.video-source .flex-grow {
    min-width: 0; /* 允许容器缩小 */
    flex-shrink: 1; /* 允许收缩 */
}

/* 复制按钮样式 */
.copy-button {
    flex-shrink: 0; /* 防止按钮缩小 */
    white-space: nowrap; /* 防止文字换行 */
    padding: 0.5rem 1rem;
    min-width: fit-content; /* 确保按钮宽度适应内容 */
}

/* 源地址URL样式 */
.source-url {
    text-overflow: ellipsis; /* 超出显示省略号 */
    overflow: hidden;
    white-space: nowrap;
}

/* 深色主题适配 */
[data-theme="dark"] .video-source {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .source-url {
    color: rgba(255, 255, 255, 0.9);
}

/* 封面图片区域样式 */
.cover-image-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    background-color: transparent; /* 移除背景色 */
}

/* 移除点击区域提示框样式 */
.cover-image-container::after {
    display: none; /* 移除提示框 */
}

/* 视频控制区域样式 */
.video-controls {
    display: flex;
    justify-content: space-between; /* 两端对齐 */
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
    gap: 1rem;
}

/* 左侧自动播放开关组 */
.video-controls-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: auto; /* 确保左侧元素靠左 */
}

/* 自动播放开关容器 */
.autoplay-toggle {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 移除旧的margin-left设置 */
.video-controls .autoplay-toggle + .autoplay-toggle {
    margin-left: 0; /* 移除旧的margin设置 */
}

/* 下一个按钮样式 */
.next-button {
    margin-left: auto; /* 确保按钮靠右 */
}

/* 确保移动端布局正确 */
@media (max-width: 640px) {
    .video-controls {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .video-controls-left {
        gap: 0.5rem;
    }
    
    .autoplay-toggle label {
        font-size: 0.875rem;
    }
    
    .next-button {
        padding: 0.5rem 0.75rem;
    }
}

/* 视频播放器容器样式 */
#playerTab .max-w-4xl {
    width: 100%;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 视频播放器容器 */
#playerTab .relative {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* 视频播放器过渡动画 */
#videoPlayer {
    max-height: calc(100vh - 300px); /* 减小最大高度，为按钮留出空间 */
    object-fit: contain;
    background-color: #000;
    transition: all 0.3s ease-in-out;
    min-height: 200px;
    width: 100%;
    margin: 0 auto;
}

/* 视频加载中状态 */
#videoPlayer.loading {
    opacity: 0.6;
    filter: brightness(0.8);
}

/* 下一个按钮容器 */
#playerTab .flex.justify-center {
    margin-top: 1rem;
    padding-bottom: 1rem;
    flex-shrink: 0; /* 防止按钮被压缩 */
}

/* 视频播放器过渡动画 */
#videoPlayer {
    max-height: calc(100vh - 300px); /* 减小最大高度，为按钮留出空间 */
    object-fit: contain;
    background-color: #000;
    transition: all 0.3s ease-in-out;
    min-height: 200px;
    width: 100%;
    margin: 0 auto;
}

/* 视频加载中状态 */
#videoPlayer.loading {
    opacity: 0.6;
    filter: brightness(0.8);
}

/* NSFW 警告样式 */
.nsfw-warning {
    color: #dc2626;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0.5rem;
    background-color: rgba(220, 38, 38, 0.1);
    border-radius: 0.375rem;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* 自动播放开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: all 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
}

#autoplayToggle:checked + label .toggle-switch {
    background-color: var(--primary-color);
}

#autoplayToggle:checked + label .toggle-switch::after {
    transform: translateX(20px);
}

#autoNextToggle:checked + label .toggle-switch {
    background-color: var(--primary-color);
}

#autoNextToggle:checked + label .toggle-switch::after {
    transform: translateX(20px);
}

/* 适配移动端全屏问题 */
#videoPlayer::-webkit-media-controls {
    will-change: transform;
}

#videoPlayer::-webkit-media-controls-panel {
    display: flex !important;
    opacity: 1 !important;
}

#videoPlayer::-webkit-media-controls-play-button {
    display: flex !important;
    opacity: 1 !important;
}

/* 确保视频控件在全屏时可见 */
#videoPlayer:fullscreen::-webkit-media-controls-panel,
#videoPlayer:-webkit-full-screen::-webkit-media-controls-panel {
    display: flex !important;
    opacity: 1 !important;
}

/* 修改消息通知样式，确保在浅色主题下字体为白色 */
[data-theme="light"] .notification {
    background: var(--primary-color);
    color: #ffffff;
}

/* 特殊处理加载中状态的通知 */
[data-theme="light"] .notification.loading {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

[data-theme="light"] .notification.loading svg {
    color: #1f2937;
}

/* 优化视频播放页面在浅色主题下的对比度 */
[data-theme="light"] .video-source {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

[data-theme="light"] .source-url {
    color: #1f2937;
}

[data-theme="light"] .source-label {
    color: #4b5563;
}

[data-theme="light"] .video-controls {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .toggle-switch {
    background-color: #d1d5db;
}

[data-theme="light"] .nsfw-warning {
    background-color: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

/* 确保复制按钮在浅色主题下的文字颜色为白色 */
[data-theme="light"] .copy-button {
    color: #ffffff;
}

/* 确保下一个按钮在浅色主题下的文字颜色为白色 */
[data-theme="light"] .next-button {
    color: #ffffff;
}

/* 主题图标样式优化 */
[data-theme="dark"] #themeToggle svg {
    color: #94a3b8;
}

[data-theme="light"] #themeToggle svg {
    color: #fbbf24;
}

/* 修改主题菜单中的图标 */
.theme-menu-item[data-theme="dark"] svg {
    /* 月亮图标 */
    color: #94a3b8;
}

.theme-menu-item[data-theme="light"] svg {
    /* 太阳图标 */
    color: #fbbf24;
}

.theme-menu-item[data-theme="emerald"] svg {
    /* 翠绿主题图标 */
    color: #10b981;
}

.theme-menu-item[data-theme="ocean"] svg {
    /* 海蓝主题图标 */
    color: #3b82f6;
}

.theme-menu-item[data-theme="amethyst"] svg {
    /* 紫晶主题图标 */
    color: #8b5cf6;
}

/* 修复日间主题下自动播放文字颜色 */
[data-theme="light"] .autoplay-toggle label {
    color: #1f2937;
}

/* 里番合集描述文本样式 */
.collection-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    padding: 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    max-width: 6xl;
    margin-left: auto;
    margin-right: auto;
}

[data-theme="light"] .collection-description {
    color: #6b7280;
}

/* 封面图开关样式 */
.cover-toggle {
    display: flex;
    align-items: center;
}

.cover-toggle .toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: all 0.3s;
}

.cover-toggle .toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
}

#coverToggle:checked + label .toggle-switch {
    background-color: var(--primary-color);
}

#coverToggle:checked + label .toggle-switch::after {
    transform: translateX(20px);
}

/* 浅色主题下的封面图开关样式 */
[data-theme="light"] .cover-toggle label {
    color: #1f2937;
}

[data-theme="light"] .cover-toggle .toggle-switch {
    background-color: #d1d5db;
}

[data-theme="light"] #coverToggle:checked + label .toggle-switch {
    background-color: var(--primary-color);
}

/* Footer 样式 */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--card-dark);
    border-top: 1px solid var(--border-color);
    z-index: 30;
    padding: 1rem 0;
}

/* 为主要内容添加底部内边距，防止被 footer 遮挡 */
main {
    padding-bottom: 80px;
}

/* 亮色主题下的 footer 样式 */
[data-theme="light"] footer {
    background: #ffffff;
    border-color: #e5e7eb;
}

/* 确保返回顶部按钮在 footer 上方 */
.back-to-top {
    z-index: 50;
    margin-bottom: 60px;
}

/* 添加模态框加载指示器 */
.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    z-index: 10;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 确保模态框内容区域有相对定位 */
.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    min-height: 200px;
    min-width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 改进模态框图片加载过程 */
.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
}

.image-modal.active .modal-image {
    opacity: 1;
    animation: zoomIn 0.3s forwards;
}

/* 添加键盘事件处理，支持ESC关闭和方向键切换图片 */
.image-modal.active {
    opacity: 1;
    visibility: visible;
}

/* 添加图片加载失败时的提示 */
.modal-image.error::before {
    content: '图片加载失败';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
}

/* 全宽预览图样式 */
.fullwidth-preview {
    width: 96vw !important;
    max-width: 96vw !important;
    height: auto !important;
    max-height: 90vh !important;
    object-fit: contain !important;
}

/* 改进模态框样式以适应全宽图片 */
.modal-content {
    position: relative;
    max-width: 96vw;
    max-height: 90vh;
    min-height: 200px;
    min-width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 确保模态框内容居中 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* 改进模态框图片加载过程 */
.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
}

/* 添加图片加载错误状态 */
.modal-image.error {
    min-width: 300px;
    min-height: 200px;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.modal-image.error::after {
    content: '图片加载失败';
    position: absolute;
    color: white;
    font-size: 16px;
}

/* 添加提示文本 */
.image-modal::after {
    content: '点击任意位置关闭';
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    pointer-events: none;
}

/* 热门搜索词区域样式 */
.hot-searches {
    padding: 8px 12px;
    background: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 0 4px;
}

/* 热门搜索标签样式 */
.hot-search-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}

.hot-search-tag:hover {
    background: rgba(var(--primary-color-rgb), 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 热门搜索文字样式 */
.hot-searches .label-text {
    color: var(--text-primary);
    font-weight: 500;
}

/* 日间主题适配 */
[data-theme="light"] .hot-searches {
    background: #ffffff;
    border-color: #e5e7eb;
}

[data-theme="light"] .hot-search-tag {
    background: rgba(var(--primary-color-rgb), 0.08);
    border-color: rgba(var(--primary-color-rgb), 0.15);
}

[data-theme="light"] .hot-search-tag:hover {
    background: rgba(var(--primary-color-rgb), 0.12);
}

[data-theme="light"] .hot-searches .label-text {
    color: #374151;
}
